﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms; 
using CourseArraging.Frm;
using CourseArraging.Common;
using CourseArraging.Frm.jcxx;
using CourseArraging.Frm.jygl;
using CourseArraging.Frm.xygl;
using CourseArraging.Frm.jxgl;

namespace CourseArraging
{
    public partial class FrmMain : Form
    {
        #region 构造函数
        public FrmMain()
        {
            InitializeComponent();
            this.FormClosing += new FormClosingEventHandler(FrmMain_FormClosing);
            GlobalVar.frmMain = this;
            this.tsStatus_user.Text = GlobalVar.yhEntity.user_name;
            this.uCtree1.treeView1.NodeMouseDoubleClick += new TreeNodeMouseClickEventHandler(treeView1_NodeMouseDoubleClick);
        }

        void treeView1_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            switch (e.Node.Text)
            {
                case "教员档案登记":
                    FrmTecInfo.GetInstance().Show();
                    break;
                case "教员档案查看":
                    FrmTecList.GetInstance().Show();
                    break;
                case "学员档案登记":
                    FrmStuInfo.GetInstance().Show();
                    break;
                case "学员档案查看":
                    FrmStuList.GetInstance(true).Show();
                    break;
                case "未安排的学员信息":
                    FrmStuList.GetInstance(false).Show();
                    break;
                case "签订协议":
                    FrmQdxy frm = new FrmQdxy();
                    frm.ShowDialog();
                    break;
                case "授教情况":
                    FrmWXYlist.GetInstance("qdxy_zt='正在授课'").Show();
                    break;
                case "授教情况查询":
                    FrmXylist.GetInstance().Show();
                    break;
                case "学校":
                    FrmJcxxSchool.GetInstance().Show();
                    break;
                case "年级":
                    FrmJcxxGrade.GetInstance().Show();
                    break;
                case "课程":
                    FrmJcxxCourse.GetInstance().Show();
                    break;
            }  
        }
        #endregion

        #region 事件

        void FrmMain_FormClosing(object sender, FormClosingEventArgs e)
        {
            Application.Exit();
        }

        #region 菜单栏

        #region 个人设置
        private void 个人信息ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmUserInfo.GetInstance().Show();
        }

        private void 更新权限ToolStripMenuItem_Click(object sender, EventArgs e)
        {

        }

        private void 退出ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Close();
        }
        #endregion

        #region 教员管理

        private void 教员档案查看ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmTecList.GetInstance().Show();
        }

        private void 教员档案登记ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmTecInfo.GetInstance().Show();
        }
        #endregion

        #region 学员管理

        private void 学员档案登记ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmStuInfo.GetInstance().Show();
        }

        private void 学员档案查看ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmStuList.GetInstance(true).Show();
        }

        private void 未安排学员ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmStuList.GetInstance(false).Show();
        }

        #endregion

        #region 授课管理

        private void 签订协议ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmQdxy frm = new FrmQdxy();
            frm.ShowDialog();
        }

        private void 授教情况ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmWXYlist.GetInstance("qdxy_zt='正在授课'").Show();
        }

        private void 授教情况查询ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmXylist.GetInstance().Show();
        }

        #endregion

        #region 基础信息

        private void 学校toolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmJcxxSchool.GetInstance().Show();
        }

        private void 年级toolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmJcxxGrade.GetInstance().Show();
        }

        private void 课程toolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmJcxxCourse.GetInstance().Show();
        }

        #endregion

        #region 系统

        private void 文件ToolStripMenuItem_Click(object sender, EventArgs e)
        {

        }

        private void 工具ToolStripMenuItem_Click(object sender, EventArgs e)
        {

        }

        private void 视图ToolStripMenuItem_Click(object sender, EventArgs e)
        {

        }

        private void 帮助ToolStripMenuItem_Click(object sender, EventArgs e)
        {

        }
        #endregion

        #endregion

        #region 左快捷

        private void 隐藏显示系统导航栏toolStripButton1_Click(object sender, EventArgs e)
        {

        }

        private void 隐藏显示信息管理树toolStripButton2_Click(object sender, EventArgs e)
        {
            panel1.Visible = !panel1.Visible;
        }

        private void 录入窗口toolStripButton3_Click(object sender, EventArgs e)
        {

        }

        private void 打印信息toolStripButton4_Click(object sender, EventArgs e)
        {

        }

        private void 教员通讯录toolStripButton5_Click(object sender, EventArgs e)
        {
            FrmTecList.GetInstance().Show();
        }

        private void 学员通讯录toolStripButton6_Click(object sender, EventArgs e)
        {
            FrmStuList.GetInstance(true).Show();
        }

        private void 教员课程表toolStripButton1_Click(object sender, EventArgs e)
        {
            FrmTecCur.GetInstance().Show();
        }

        private void 学员课程表toolStripButton2_Click(object sender, EventArgs e)
        {
            FrmStuCur.GetInstance().Show();
        }

        private void 教员周末课程统计toolStripButton_Click(object sender, EventArgs e)
        {
            FrmTecStatistics.GetInstance().Show();
        }

        private void 学员周末课程统计toolStripButton_Click(object sender, EventArgs e)
        {
            FrmStuStatistics.GetInstance().Show();
        }

        #endregion

        #region 右快捷

        private void toolStripButton_left_Click(object sender, EventArgs e)
        {
            this.panel1.Dock = DockStyle.Left;
        }

        private void toolStripButton_right_Click(object sender, EventArgs e)
        {
            this.panel1.Dock = DockStyle.Right;
        }

        #endregion




        #endregion
    }
}
